@extends('admin.layout.layout')
@section('content')
    <div class="mws-panel grid_8">
        {{session('error')}}
        @if(count($errors)>0)
        <div class="mws-form-message warning">
            <ul>
                @foreach($errors->all() as $error)
                    <li>{{$error}}</li>
                @endforeach
            </ul>
        </div>
        @endif
        <div class="mws-panel-header">
            <span>添加用户</span>
        </div>
        <div class="mws-panel-body no-padding">
            <form action="{{url('admin/goods/insert')}}" method="POST" enctype="multipart/form-data" class="mws-form">
                {{csrf_field()}}
                <fieldset class="mws-form-inline">
                    <div class="mws-form-row bordered" id="parentdiv">
                        <label class="mws-form-label">主分类:</label>
                        <div class="mws-form-item">
                            <select class="small" name="cate_id" style="width:300px" >
                                <option value="0">--请选择--</option>
                                @foreach($C_data as $k=>$v)
                                    <option value="{{$v['cate_id']}}">{{str_repeat('|--',$v['cengji']) }}{{$v['cate_name']}}</option>
                                @endforeach
                            </select>
                        </div>
                        <label class="">扩展分类:</label>
                        <input type="button" value="添加" onclick="$('#parentdiv').append($('#kuozhan').clone())">
                        <div class="mws-form-item" id="kuozhan">

                            <select class="small" name="cate_kz_id[]" style="width:300px" id="" >
                                <option value="0">--请选择--</option>
                                @foreach($C_data as $k=>$v)
                                    <option value="{{$v['cate_id']}}">{{str_repeat('|--',$v['cengji']) }}{{$v['cate_name']}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                </fieldset>
                <fieldset class="mws-form-inline">
                    <div class="mws-form-row bordered">
                        <label class="mws-form-label">品牌:</label>
                        <div class="mws-form-item">
                            <select class="small" name="pp_id" style="width:300px">
                                <option value="0">--请选择--</option>
                                @foreach($P_data as $k=>$v)
                                    <option value="{{$v['pp_id']}}">{{$v['pp_name']}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                </fieldset>
                <div class="mws-form-inline">
                    <div class="mws-form-row">
                        <label class="mws-form-label">商品名称</label>
                        <div class="mws-form-item">
                            <input type="text" class="small" name="goods_name" style="width:300px">
                        </div>
                        <label class="mws-form-label">市场价格</label>
                        <div class="mws-form-item">
                            <input type="text" class="medium" name="market_price" style="width:300px">
                        </div>
                        <label class="mws-form-label">本店价格</label>
                        <div class="mws-form-item">
                            <input type="text" class="medium" name="shop_price" style="width:300px">
                        </div>
                        <label class="mws-form-label">商品描述</label>
                        <div class="mws-form-item">
                            <input type="text" class="medium" name="goods_desc" style="width:300px">
                        </div>
                        <label class="mws-form-label">图片</label>
                        <div class="mws-form-item">
                            <input type="file" class="medium" name="goods_img" style="width:300px">
                        </div>


                        <label class="mws-form-label">是否上架</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_on_sale" value="否" checked > <label>否</label></li>
                                <li><input type="radio" name="is_on_sale" value="是"> <label>是</label></li>
                            </ul>
                        </div>
                        <label class="mws-form-label">是否新品</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_new" value="否" checked > <label>否</label></li>
                                <li><input type="radio" name="is_new" value="是"> <label>是</label></li>
                            </ul>
                        </div>
                        <label class="mws-form-label">是否热销</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_hot" value="否" checked > <label>否</label></li>
                                <li><input type="radio" name="is_hot" value="是"> <label>是</label></li>
                            </ul>
                        </div>
                        <label class="mws-form-label">是否推荐</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_tuijian" value="否" checked > <label>否</label></li>
                                <li><input type="radio" name="is_tuijian" value="是"> <label>是</label></li>
                            </ul>
                        </div>
                        <label class="mws-form-label">是否推荐楼层</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_floor" value="否" checked > <label>否</label></li>
                                <li><input type="radio" name="is_floor" value="是"> <label>是</label></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="mws-button-row">
                    <input type="submit" class="btn btn-danger" value="添加">
                    <input type="reset" class="btn " value="重置">
                </div>
            </form>
        </div>
    </div>
    @endsection
